﻿<%@ Page Language="C#" AutoEventWireup="True" EnableViewState="false" CodeBehind="Index.aspx.cs" Inherits="eBlog.Web.Admin.Index" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>后台管理中心</title>
<meta content="Comsenz Inc." name="Copyright" />
<link href="resources/css/style.css" rel="stylesheet" type="text/css" />
<script src="resources/scripts/common.js" type="text/javascript"></script>

</head>

<body style="margin: 0px" scroll="no">
<div id="append_parent"></div>
<table id="frametable" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td colspan="2" height="90">
<div class="mainhd">
<div class="logo">Team Administrator's Control Panel</div>
<div class="uinfo" id="frameuinfo">
<p>您好, 管理员 <em><asp:Literal ID="AdminName" runat="server"></asp:Literal></em>  [ <a href="main.aspx?action=editpass" target="main">修改密码</a> ]   [ <a href="Login.aspx?action=quit" target="_top">退出</a> ]</p>
<p class="btnlink"><a href="/" target="_blank">站点首页</a></p>
</div>
<div class="navbg"></div>
<div class="nav">

<ul id="topmenu">

<li><em><a href="" id="header_main" hidefocus="true" onclick="toggleMenu('main', 'main.aspx');doane(event);">首页</a></em></li>
<li><em><a href="" id="header_global" hidefocus="true" onclick="toggleMenu('global', 'Setting.aspx');doane(event);">站点设置</a></em></li>
<li><em><a href="" id="header_Posts" hidefocus="true" onclick="toggleMenu('Posts', 'PostsManage.aspx');doane(event);">文章</a></em></li>
<li><em><a href="" id="header_Pages" hidefocus="true" onclick="toggleMenu('Pages', 'PageManage.aspx');doane(event);">页面</a></em></li>
<li><em><a href="" id="header_User" hidefocus="true" onclick="toggleMenu('User', 'UserManage.aspx');doane(event);">用户</a></em></li>
<li><em><a href="" id="header_link" hidefocus="true" onclick="toggleMenu('link', 'LinksManage.aspx');doane(event);">链接</a></em></li>
<li><em><a href="" id="header_permission" hidefocus="true" onclick="toggleMenu('permission', 'AdminManage.aspx');doane(event);">权限</a></em></li>
</ul>
<div class="currentloca">
<p id="admincpnav">当前位置</p>
</div>

<div class="navbd"></div>
<div class="sitemapbtn">
	<div style="float: left; margin:-5px 10px 0 0">
			<form name="search" method="post" autocomplete="off" action="" target="main">
				<input type="text" name="keywords" value="" class="txt" />
				<input type="hidden" name="searchsubmit" value="yes" class="btn" />
				<input type="submit" name="searchsubmit" value="搜索" class="btn" style="margin-top: 5px;vertical-align:middle" />
			</form>
	</div>
	<span id="add2custom" style="display: none"></span>
	<a href="###" id="cpmap" onclick="showMap();return false;"><img src="/admin/resources/images/btn_map.gif" title="管理中心导航(ESC键)" width="46" height="18" /></a>
</div>
</div>
</div>
</td>
</tr>

<tr>
<!-- 左栏 菜单栏 -->
<td valign="top" width="160" class="menutd">
<div id="leftmenu" class="menu">

<ul id="menu_main" style="display: none">
	<li><a href="main.aspx" hidefocus="true" target="main">管理中心首页</a></li>
    <li><a href="PostsManage.aspx?action=add" hidefocus="true" target="main">新建文章</a></li>
    <li><a href="PostsManage.aspx" hidefocus="true" target="main">文章管理</a></li>
	<li><a href="AdminManage.aspx" hidefocus="true" target="main">管理员管理</a></li>
	<li><a href="AdminManage.aspx?action=add" hidefocus="true" target="main">添加管理员</a></li>
</ul>

<ul id="menu_global" style="display: none">
	<li><a href="Setting.aspx" hidefocus="true" target="main">网站设置</a></li>
    <li><a href="ThemeManage.aspx" hidefocus="true" target="main">主题管理</a></li>
	<li><a href="main.aspx" hidefocus="true" target="main">注册与访问</a></li>

</ul>

<ul id="menu_Posts" style="display: none">
	<li><a href="PostsManage.aspx" hidefocus="true" target="main">文章管理</a></li>
	<li><a href="PostTypeManage.aspx" hidefocus="true" target="main">类型管理</a></li>
    <li><a href="TagsManage.aspx" hidefocus="true" target="main">标签管理</a></li>
	<li><a href="CommentsManage.aspx" hidefocus="true" target="main">评论管理</a></li>
</ul>

<ul id="menu_Pages" style="display: none">
	<li><a href="PageManage.aspx?action=add" hidefocus="true" target="main">增加页面</a></li>
	<li><a href="PageManage.aspx" hidefocus="true" target="main">页面管理</a></li>
   
</ul>


<ul id="menu_User" style="display: none">
	<li><a href="UserManage.aspx" hidefocus="true" target="main">用户列表</a></li>
</ul>

<ul id="menu_link" style="display: none">
	<li><a href="LinksManage.aspx" hidefocus="true" target="main">链接管理</a></li>
</ul>

<ul id="menu_permission" style="display: none">
	<li><a href="AdminManage.aspx" hidefocus="true" target="main">管理员管理</a></li>
	<li><a href="AdminManage.aspx?action=add" hidefocus="true" target="main">添加管理员</a></li>
	<li><a href="AdminRoleManage.aspx" hidefocus="true" target="main">角色组管理</a></li>
	<li><a href="AdminRoleManage.aspx?action=add" hidefocus="true" target="main">添加角色组</a></li>
</ul>
</div>
</td>
<!-- 右栏 内容栏 -->
<td valign="top" width="100%" class="mask">
	<iframe src="main.aspx" id="main" name="main" width="100%" height="100%" frameborder="0" scrolling="yes" style="overflow: visible;display:"></iframe>
</td>
</tr>
</table>


<div class="copyright">
	<p>Powered by <a href="http://eblog.codeplex.com" target="_blank">Eblog </a>Team v1</p>
	<p>&copy; 2010-2012, <a href="http://eblog.codeplex.com" target="_blank">BangQ!</a></p>
</div>

<div id="cpmap_menu" class="custom" style="display: none">
	<div class="cmain" id="cmain"></div>
	<div class="cfixbd"></div>
</div>

<script type="text/JavaScript">
    var headers = new Array('main', 'global', 'User', 'Posts', 'Pages', 'link','permission'), menukey = '';
    

	function switchheader(key) {
		if(!key || !$('header_' + key)) {
			return; //无此头部菜单
		}
		for(var k in top.headers) {
			if($('menu_' + headers[k])) {
				$('menu_' + headers[k]).style.display = headers[k] == key ? '' : 'none'; //遍历切换menu左菜单呈现
			}
		}
		var lis = $('topmenu').getElementsByTagName('li');
		for(var i = 0; i < lis.length; i++) {
			if(lis[i].className == 'navon') lis[i].className = '';//清空顶菜单样式
		}
		$('header_' + key).parentNode.parentNode.className = 'navon'; //设置当前顶菜单navon突出
	}

	function toggleMenu(key, url) {
		menukey = key;
		switchheader(key);
		if(url) {
			parent.main.location = url; //如果有url,内容栏先装载url显示
			var hrefs = $('menu_' + key).getElementsByTagName('a');
			for(var j = 0; j < hrefs.length; j++) {
			    var weizhi = hrefs[j].href.indexOf(url);
			    var jiequ = hrefs[j].href.substr(weizhi);
			    
			    //alert('获得的:'+hrefs[j].href + '|在位置:' + weizhi + '|截取到:'+jiequ+'|设置的:'+url);	
				hrefs[j].className = hrefs[j].href.substr(hrefs[j].href.indexOf(url)) == url ? 'tabon' : (hrefs[j].className == 'tabon' ? '' : hrefs[j].className);
			}
		}
		setMenuScroll();
	}
	
	function setMenuScroll() {
		$('frametable').style.width = document.body.offsetWidth < 1000 ? '1000px' : '100%';
		var obj = $('menu_' + menukey);
		if(!obj) {
			return;
		}
	}
	
	function initCpMenus(menuContainerid) {
		var key = '';
		var hrefs = $(menuContainerid).getElementsByTagName('a');
		for(var i = 0; i < hrefs.length; i++) {
			if(menuContainerid == 'leftmenu' && !key)
			{
				key = hrefs[i].parentNode.parentNode.id.substr(5);
				hrefs[i].className = 'tabon';
			}
			if(!hrefs[i].getAttribute('ajaxtarget')) hrefs[i].onclick = function() {
				if(menuContainerid != 'custommenu') {
					var lis = $(menuContainerid).getElementsByTagName('li');
					for(var k = 0; k < lis.length; k++) {
						if(lis[k].firstChild.className != 'menulink') lis[k].firstChild.className = ''; //奶奶的,先把全部li弄空样式
					}
					if(this.className == '') this.className = menuContainerid == 'leftmenu' ? 'tabon' : 'bold'; //再把点击的这个a标签弄亮
				}
			}
		}
		return key;
	}
	var header_key = initCpMenus('leftmenu');
	toggleMenu(header_key ? header_key : 'main.aspx');

	function initCpMap() {
		var ul, hrefs, s;
		s = '<ul class="cnote"><li style="margin-right:5px"><a href="javascript:;" onclick="hideMenu()"><img src="/admin/resources/images/btn_map.gif" /></a></li><li><h3>管理中心导航</h3></li></ul>' +
			'<div class="cmlist"><table id="mapmenu"><tr>';
		for(var k in headers) {
			if(headers[k] != 'index' && headers[k] != 'uc') {
				s += '<td valign="top"><ul class="cmblock"><li><h4>' + $('header_' + headers[k]).innerHTML + '</h4></li>';
				ul = $('menu_' + headers[k]);
				if(!ul) {
					continue;
				}
				hrefs = ul.getElementsByTagName('a');
				for(var i = 0; i < hrefs.length; i++) {
					s += '<li><a href="' + hrefs[i].href + '" target="' + hrefs[i].target + '" k="' + headers[k] + '">' + hrefs[i].innerHTML + '</a></li>';
				}
				s += '<li></li></ul></td>';
			}
		}
		s += '</tr></table></div>';
		return s;
	}

	$('cmain').innerHTML = initCpMap();

	var cmcache = false;

	function showMap() {
		showMenu({'ctrlid':'cpmap','evt':'click', 'duration':3, 'pos':'00'});
	}
</script>
</body>
</html>